﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PlanejadoDeFestas
{
    public partial class Form1 : Form
    {
        Festajantar festa;
        FestaAniversario festani;
        public Form1()
        {
            InitializeComponent();
            festa = new Festajantar((int)numericUpDown1.Value, checkBox1.Checked, checkBox2.Checked);
            festani = new FestaAniversario((int) numericUpDown2.Value, checkBox3.Checked, escrita.Text);
            displayCustototal();
            displayCustofesta();

        }
        private void displayCustototal()
        {
            decimal custo = festa.CustoTotal(checkBox2.Checked);
            label3.Text = custo.ToString("c");
        }

        private void displayCustofesta()
        {
            decimal custo = festani.CustoTotal();
            label7.Text = custo.ToString("c");
        }

        private void numericUpDown1_ValueChanged_1(object sender, EventArgs e)
        {
            festa.NumeroDePessoas = (int)numericUpDown1.Value;
            displayCustototal();
        }

        private void checkBox1_CheckedChanged_1(object sender, EventArgs e)
        {
            festa.CalcularCustoDaDecoração(checkBox1.Checked);
            displayCustototal();
        }

        private void checkBox2_CheckedChanged_1(object sender, EventArgs e)
        {
            festa.OpcaoSaudavelEscolhida(checkBox2.Checked);
            displayCustototal();
        }

        private void numericUpDown2_ValueChanged(object sender, EventArgs e)
        {
            festani.NumeroDePessoas = (int)numericUpDown2.Value;
            displayCustofesta();
        }

        private void escrita_TextChanged(object sender, EventArgs e)
        {
            festani.EscritaDoBolo = escrita.Text;
           displayCustofesta();
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            festani.CalcularCustoDaDecoração(checkBox3.Checked);
            displayCustofesta();
        }


 

        
      
    }
}
